﻿@model MetaPropertiesModel

<widget target-zone="head">
    <meta property='og:site_name' content='@Model.SiteName' />
    <meta property='og:site' content='@Model.Site' />
    <meta property='og:url' content='@Model.Url' />
    <meta property='og:type' content='@Model.Type' />
    <meta property='og:title' content='@Html.Encode(Model.Title)' />
    <meta property='twitter:card' content='summary' />
    <meta property='twitter:title' content='@Html.Encode(Model.Title)' />

    @if (Model.Description.HasValue())
    {
        <meta property='og:description' content='@Html.Encode(Model.Description)' />
        <meta property='twitter:description' content='Html.Encode(Model.Description)' />
    }

    @if (Model.ImageUrl.HasValue())
    {
        <meta property='og:image' content='@Model.ImageUrl' />
        <meta property='og:image:type' content='@Model.ImageType' />
        <meta property='twitter:image' content='@Model.ImageUrl' />

        if (Model.ImageAlt.HasValue())
        {
            <meta property='og:image:alt' content='@Html.Encode(Model.ImageAlt)' />
            <meta property='twitter:image:alt' content='@Html.Encode(Model.ImageAlt)' />
        }

        if (Model.ImageWidth > 0 && Model.ImageHeight > 0)
        {
            <meta property='og:image:width' content='@Model.ImageWidth' />
            <meta property='og:image:height' content='@Model.ImageHeight' />
        }
    }

    <meta sm-if="Model.ArticleSection.HasValue()" property='article:section' content='@Model.ArticleSection' />

    @if (Model.ArticleTags != null && Model.ArticleTags.Count() > 0)
    {
        foreach (var articleTag in Model.ArticleTags)
        {
            <meta property='article:tag' content='@articleTag' />
        }
    }

    <meta sm-if="Model.PublishedTime != DateTime.MinValue" property='article:published_time' content='@Model.PublishedTime' />
    <meta sm-if="Model.TwitterSite.HasValue()" property='twitter:site' content='@Model.TwitterSite' />
    <meta sm-if="Model.FacebookAppId.HasValue()" property='fb:app_id' content='@Model.FacebookAppId' />
</widget>